<!doctype html>
<html>
<head>
    <title>{$INI['system']['sitename']} {$city['name']}</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="stylesheet" href="/css/style.css">
    <link rel="stylesheet" href="/css/font-awesome.min-4.3.0.css">
	<script src="/js/jquery.min-2.1.3.js" type="text/javascript"></script>
</head>
<style>

.address_list ul.cur::before{background-position:0px -50px;}
</style>
<body>
    <div class="wx_bar">
        <div class="wx_bar_back">
            <a id="listPageback" href="javascript:void(0);"></a>
        </div>
        <div class="wx_bar_act">
            <a href="javascript:void(0);" class="wx_bar_new" style="display: none;" id="_new"></a>
        </div>
    </div>
    <div class="wx_wrap">
        <div class="address_list" id="addressList" style="-webkit-transform-origin: 0px 0px; opacity: 1; -webkit-transform: scale(1, 1);">
            <div>
				<!--{loop $add $index $one}-->
                <div class="address ">
                    <ul class="<!--{if $one['default'] == 'Y'}-->cur <!--{/if}-->">
                        
						<a href="javascript:;" class="chang_df_addr" rel="/ajax/setdefaddress.php?action=change&id={$one['id']}&refurl={$refurl}" style=" height: 20px;left: 10px;margin-top: -10px;position: absolute;top: 50%;width: 20px;"></a>
						
						<li>{$one['province']}  &nbsp;  {$one['city']} &nbsp; {$one['area']} &nbsp;{$one['street']}</li>
                        <li><strong>{$one['name']}</strong>{$one['mobile']}</li>
                        <li class="edit"><a href="/account/setaddress.php?act=edit&id={$one['id']}&refurl={$refurl}">编辑</a></li>
                    </ul>
                </div>
				<!--{/loop}-->
            </div>
            <div class="address_list_link">
                <a href="/account/setaddress.php?act=add&refurl={$refurl}" class="item item_new" style="" id="new">新增收货地址</a>
                <a href="javascript:void(0);" class="item item_wx" style="display: none;" id="selAddrFromWx">从微信选择地址</a>
            </div>
            <div class="margin_footer"></div>
        </div>
    </div>
	<script>
		$(function(){
			$('.chang_df_addr').click(function(){
			//alert($(this).attr('rel'));
			var obj = $(this);
				var s_url = $(this).attr('rel');
				$.ajax({
					url:s_url,
					type:'GET',
					dataType:'json',
					success:function(res){
						$('.address ul').removeClass('cur');
						obj.parent('ul').addClass('cur');
						alert('默认地址切换成功.');
						if(res.has_ref) {
							location.href = res.refurl;
							return  false;
						}
					}
				})
			});
		})
	</script>
    <!--{include footer}-->
</body>
</html>
